home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / ViewIt™ 2.24 Shareware / C++ Demo Projects / Metrowerks C++ 1.0a4 Demos / TutorialMC+.cp < prev    next >
Text File  |  1994-03-02  |  1KB  |  52 lines

  1. /* Tutorial MC+ Demonstration Program */
  2. /* ©FaceWare 1993-94.  All Rights Reserved. */
  3.  
  4. #include <string.h>
  5. #include "FaceStorMC+.h"
  6. extern struct FaceRec fRec;
  7.  
  8. short theFlag,theListItem,theMenuItem;
  9. char theString[32];
  10.  
  11. void main()
  12. {
  13.     strcpy(fRec.uName, "Tutorial.Rsrc");
  14.     FaceIt(0,DoInit);
  15.     theFlag = 0;
  16.     theListItem = 3;
  17.     theMenuItem = 2;
  18.     strcpy(theString,"Hello");
  19.     for (;;) {
  20.         FaceIt(0,DoLoop);
  21.         if ((fRec.uMenuID == 105)&&(fRec.uMenuItem == 1))
  22.             {
  23.             FaceIt(0,NewWnd,1010);
  24.             FaceIt(0,GetCtl,1010,0,1,3);
  25.             FaceIt(0,LnkCtl,(long)fRec.cControl,(long)&theFlag,2);
  26.             FaceIt(0,GetCtl,1010,0,1,4);
  27.             FaceIt(0,LnkCtl,(long)fRec.cControl,(long)theString,-31);
  28.             FaceIt(0,GetCtl,1010,0,1,5);
  29.             FaceIt(0,LnkCtl,(long)fRec.cControl,(long)&theListItem,2);
  30.             FaceIt(0,GetCtl,1010,0,1,6);
  31.             FaceIt(0,LnkCtl,(long)fRec.cControl,(long)&theMenuItem,2);
  32.             FaceIt(0,SetVal,1010);
  33.             for (;;) {
  34.                 FaceIt(0,MdlWnd,1010);
  35.                 if (fRec.uMenuID == 1010) {
  36.                     if (fRec.wcHit == -1)
  37.                         break;
  38.                     else if (fRec.wcHit == 1) {
  39.                         FaceIt(0,GetVal,1010);
  40.                         break;
  41.                         }
  42.                     else if (fRec.wcHit == 2) {
  43.                         FaceIt(0,GetCtl,1010,0,1,8);
  44.                         strcpy(fRec.uString,"Run button was hit.");
  45.                         FaceIt(fRec.cControl,1565,2);
  46.                         }
  47.                     }
  48.                 }
  49.             FaceIt(0,EndWnd,1010);
  50.             }
  51.         }
  52. }